//
//  ChooseCityView.m
//  WeatherOFChangsha
//
//  Created by zkingsoft on 15/12/16.
//  Copyright (c) 2015年 zkingsoft. All rights reserved.
//

#import "ChooseCityView.h"

@implementation ChooseCityView

- (instancetype)init{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed:103/255.0 green:180/255.0 blue:199/255.0 alpha:1.0];
        
        // 返回按钮
        self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.backButton setTitle:@"返回" forState:UIControlStateNormal];
        [self.backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self addSubview:self.backButton];
        [self.backButton makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.left).offset(6);
            make.top.equalTo(self.top).offset(26);
            make.width.equalTo(60);
            make.height.equalTo(44);
        }];
        
        // pickerView
        self.cityPickerView = [[UIPickerView alloc] init];
        [self addSubview:self.cityPickerView];
        [self.cityPickerView makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.left);
            make.right.equalTo(self.right);
            make.top.equalTo(self.top).offset(160);
            make.height.equalTo(164);
        }];
        
        // sureButton
        self.sureCityButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.sureCityButton setTitle:@"确认城市" forState:UIControlStateNormal];
        [self.sureCityButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.sureCityButton.layer.cornerRadius = 6.18;
        [self.sureCityButton setBackgroundColor:[UIColor colorWithRed:130/255.0 green:200/255.0 blue:220/255.0 alpha:1.0]];
        [self addSubview:self.sureCityButton];
        [self.sureCityButton makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.left).offset(6);
            make.right.equalTo(self.right).offset(-6);
            make.height.equalTo(44);
            make.top.equalTo(self.cityPickerView.bottom).offset(16);
        }];
        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
